<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>     
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setDateHeader("Expires", 0);
	response.setContentType("text/html;charset=UTF-8");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>注   册</title>
<link type="text/css" rel="stylesheet" href="css/style.css" />
</head>
<body>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript">
	$(function(){
		$("#name").blur(function(){
			var name = $(this).val();
			$.ajax({
				url:"nameRegister.action",
				type:"get",
				data:"user.vu_user_name="+name,
				dataType:"text",
				success:function(result){
					$("#nameInfo").html(result);
				}
			});
		});
		$("#password").blur(function(){
			var password = $(this).val();
			$.ajax({
				url:"paswwordRegister.action",
				type:"get",
				data:"user.vu_password="+password,
				dataType:"text",
				success:function(result){
					$("#passwordInfo").html(result);
				}
			});
		});
		$("#confirmPassword").blur(function(){
			var confirmPassword = $(this).val();
			var password = $("#password").val();
			$.ajax({
				url:"confirmPasswordRegister.action",
				type:"get",
				data:"confirmPassword="+confirmPassword+"&user.vu_password="+password,
				dataType:"text",
				success:function(result){
					$("#confirmPasswordInfo").html(result);
				}
			});
		});
	});
	function agree(){
		if("密码填写正确"==$("#passwordInfo").text()&&"密码填写正确"==$("#confirmPasswordInfo").text()
				&&"用户名填写正确"==$("#nameInfo").text()){
			$("#sform").submit();
		}
	}
</script>
<div id="header" class="wrap">
	<img src="images/logo.gif" />
</div>
<div id="navbar" class="wrap">
	<div class="search">
	<!--  
		<form method="get" action="index.html">
			<input type="text" name="keywords" class="input-text" /><input type="submit" name="submit" class="input-button" value="" />
		</form>
	-->	
	</div>
</div>
<div id="register" class="box">
	<h2>新用户注册</h2>
	<div class="content">
	   <form method="post" action="successRegister.action" id="sform">
			<dl>
				<dt>用户名：</dt>
				<dd><input type="text" class="input-text" name="user.vu_user_name" id="name"/><span id="nameInfo"></span></dd>
				<dt>密码：</dt>
				<dd><input type="password" class="input-text" name="user.vu_password" id="password"/><span id="passwordInfo"></span></dd>
				<dt>确认密码：</dt>
				<dd><input type="password" class="input-text" name="confirmPassword" id="confirmPassword"/><span id="confirmPasswordInfo"></span></dd>
				<dt></dt>
				<dd><input type="button" class="input-button" onclick="agree()"  /></dd>
			</dl>
		</form>
	</div>
</div>
<div id="footer" class="wrap">
	云和数据 &copy; 版权所有
</div>
</body>
</html>
